package com.combetter.changxing.utils;

import android.content.Context;

/**
 * @author Vany Liu
 * e-mail liu1281781414@outlook.com
 * Created ${date} ${time}
 * description :
 **/
public class ScreenUtil {
    /**
     * 获取状态栏的高度
     * int resid = context.getResources().getIdentifier("icon_logo", "drawable", context.getPackageName())//基于资源名称的字符串找到资源所对应的ID
     iv.setImageResourece(resid);
     * @return
     */
    public static int getStatusHeight(Context context){
        int resid = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if(resid > 0){
            return context.getResources().getDimensionPixelSize(resid);//通过资源id获得资源所对应的值
        }
        return -1;
    }
}
